home *** CD-ROM | disk | FTP | other *** search
/ PD Collection CD 1 / PD Collection CD 1.iso / textual / tex / files / !tex / bibinputs / met / bst < prev   
Encoding:
BibTeX style  |  1990-02-28  |  23.4 KB  |  1,303 lines

  1. % BibTeX standard bibliography style `alpha'
  2.     % version 0.99a for BibTeX versions 0.99a or later, LaTeX version 2.09.
  3.     % Copyright (C) 1985, all rights reserved.
  4.     % Copying of this file is authorized only if either
  5.     % (1) you make absolutely no changes to your copy, including name, or
  6.     % (2) if you do make changes, you name it something other than
  7.     % btxbst.doc, plain.bst, unsrt.bst, alpha.bst, and abbrv.bst.
  8.     % This restriction helps ensure that all standard styles are identical.
  9.     % The file btxbst.doc has the documentation for this style.
  10. % Claire's bibliography style file 16/6/89 to do meteorology style
  11. % bibliography references -- viz. (Haltiner and Williams, 1985a) as label.
  12. % Now altered to do meteorology style references: Changes as listed.
  13. % The bibitems start with the names and then year with a, b etc.
  14. % added as necessary. The names are always given with initials,
  15. % the first name is in form Plotkin, G. and subsequent names are
  16. % G. Plotkin, (i.e. Jones, C., and G. Plotkin 1988a). Repeated
  17. % names from the entry above are signified with a long dash
  18. % (actually a rule box), and finally the format for volume, number
  19. % and pages gives the volume in boldface and the page range as
  20. % pp 22-37. It still puts number (if one exists) in round
  21. % bracket after the volume. Any problems, please contact
  22. % ccmj@lfcs.ed.ac.uk, Claire Jones, Lab. for the Found. of Comp. Sci,
  23. % Edinburgh University, Edinburgh, Scotland.
  24. % Finished(?) 13/10/89.
  25. ENTRY
  26.   { address
  27.     author
  28.     booktitle
  29.     chapter
  30.     edition
  31.     editor
  32.     howpublished
  33.     institution
  34.     journal
  35.     key
  36.     month
  37.     note
  38.     number
  39.     organization
  40.     pages
  41.     publisher
  42.     school
  43.     series
  44.     title
  45.     type
  46.     volume
  47.     year
  48.   }
  49.   {}
  50.   { label extra.label sort.label names}
  51.  
  52. INTEGERS { output.state before.all mid.sentence after.sentence after.block }
  53.  
  54. FUNCTION {init.state.consts}
  55. { #0 'before.all :=
  56.   #1 'mid.sentence :=
  57.   #2 'after.sentence :=
  58.   #3 'after.block :=
  59. }
  60.  
  61. STRINGS { s t }
  62.  
  63. FUNCTION {output.nonnull}
  64. { 's :=
  65.   output.state mid.sentence =
  66.     { ", " * write$ }
  67.     { output.state after.block =
  68.     { add.period$ write$
  69.       newline$
  70.       "\newblock " write$
  71.     }
  72.     { output.state before.all =
  73.         'write$
  74.         { add.period$ " " * write$ }
  75.       if$
  76.     }
  77.       if$
  78.       mid.sentence 'output.state :=
  79.     }
  80.   if$
  81.   s
  82. }
  83.  
  84. FUNCTION {output}
  85. { duplicate$ empty$
  86.     'pop$
  87.     'output.nonnull
  88.   if$
  89. }
  90.  
  91. FUNCTION {output.check}
  92. { 't :=
  93.   duplicate$ empty$
  94.     { pop$ "empty " t * " in " * cite$ * warning$ }
  95.     'output.nonnull
  96.   if$
  97. }
  98.  
  99. FUNCTION {output.bibitem}
  100. { newline$
  101.   "\bibitem[" write$
  102.   label write$
  103.   "]{" write$
  104.   cite$ write$
  105.   "}" write$
  106.   newline$
  107.   ""
  108.   before.all 'output.state :=
  109. }
  110.  
  111. FUNCTION {fin.entry}
  112. { add.period$
  113.   write$
  114.   newline$
  115. }
  116.  
  117. FUNCTION {new.block}
  118. { output.state before.all =
  119.     'skip$
  120.     { after.block 'output.state := }
  121.   if$
  122. }
  123.  
  124. FUNCTION {new.sentence}
  125. { output.state after.block =
  126.     'skip$
  127.     { output.state before.all =
  128.     'skip$
  129.     { after.sentence 'output.state := }
  130.       if$
  131.     }
  132.   if$
  133. }
  134.  
  135. FUNCTION {not}
  136. {   { #0 }
  137.     { #1 }
  138.   if$
  139. }
  140.  
  141. FUNCTION {and}
  142. {   'skip$
  143.     { pop$ #0 }
  144.   if$
  145. }
  146.  
  147. FUNCTION {or}
  148. {   { pop$ #1 }
  149.     'skip$
  150.   if$
  151. }
  152.  
  153. FUNCTION {new.block.checka}
  154. { empty$
  155.     'skip$
  156.     'new.block
  157.   if$
  158. }
  159.  
  160. FUNCTION {new.block.checkb}
  161. { empty$
  162.   swap$ empty$
  163.   and
  164.     'skip$
  165.     'new.block
  166.   if$
  167. }
  168.  
  169. FUNCTION {new.sentence.checka}
  170. { empty$
  171.     'skip$
  172.     'new.sentence
  173.   if$
  174. }
  175.  
  176. FUNCTION {new.sentence.checkb}
  177. { empty$
  178.   swap$ empty$
  179.   and
  180.     'skip$
  181.     'new.sentence
  182.   if$
  183. }
  184.  
  185. FUNCTION {field.or.null}
  186. { duplicate$ empty$
  187.     { pop$ "" }
  188.     'skip$
  189.   if$
  190. }
  191.  
  192. FUNCTION {emphasize}
  193. { duplicate$ empty$
  194.     { pop$ "" }
  195.     { "{\em " swap$ * "}" * }
  196.   if$
  197. }
  198.  
  199. FUNCTION {embolden}
  200. { duplicate$ empty$
  201.     { pop$ "" }
  202.     { "{\bf " swap$ * "}" * }
  203.   if$
  204. }
  205.  
  206. INTEGERS { nameptr namesleft numnames leastnames 
  207.       lastnumnames replacenames }
  208.  
  209. FUNCTION {format.names}
  210. { 's :=
  211.   #1 'nameptr :=
  212.   s num.names$ 'numnames :=
  213.   numnames 'namesleft :=
  214.   names chr.to.int$ "0" chr.to.int$ - 'replacenames :=
  215.   replacenames #1 + 'replacenames :=
  216.     { namesleft #0 > }
  217.     { nameptr replacenames <
  218.       { "\rule[0.5ex]{2em}{0.7pt}" 't := }
  219.       {s nameptr 
  220.        nameptr #1 = 
  221.       {"{vv~}{ll}{, jj}{, f.}" format.name$ 't :=}
  222.       {"{f.~}{vv~}{ll}{, jj}" format.name$ 't :=}
  223.        if$ }
  224.       if$
  225.       nameptr #1 >
  226.     { namesleft #1 >
  227.         { ", " * t * }
  228.         { numnames #2 >
  229.         { "," * }
  230.         'skip$
  231.           if$
  232.           t "others" =
  233.         { " et~al." * }
  234.         { ", and " * t * }
  235.           if$
  236.         }
  237.       if$
  238.     }
  239.     't
  240.       if$
  241.       nameptr #1 + 'nameptr :=
  242.       namesleft #1 - 'namesleft :=
  243.     }
  244.   while$
  245. }
  246.  
  247. FUNCTION {format.authors}
  248. { author empty$
  249.     { "" }
  250.     { author format.names }
  251.   if$
  252. }
  253.  
  254. FUNCTION {format.editors}
  255. { editor empty$
  256.     { "" }
  257.     { editor format.names
  258.       editor num.names$ #1 >
  259.     { ", editors" * }
  260.     { ", editor" * }
  261.       if$
  262.     }
  263.   if$
  264. }
  265.  
  266. FUNCTION {format.title}
  267. { title empty$
  268.     { "" }
  269.     { title "t" change.case$ }
  270.   if$
  271. }
  272.  
  273. FUNCTION {n.dashify}
  274. { 't :=
  275.   ""
  276.     { t empty$ not }
  277.     { t #1 #1 substring$ "-" =
  278.     { t #1 #2 substring$ "--" = not
  279.         { "--" *
  280.           t #2 global.max$ substring$ 't :=
  281.         }
  282.         {   { t #1 #1 substring$ "-" = }
  283.         { "-" *
  284.           t #2 global.max$ substring$ 't :=
  285.         }
  286.           while$
  287.         }
  288.       if$
  289.     }
  290.     { t #1 #1 substring$ *
  291.       t #2 global.max$ substring$ 't :=
  292.     }
  293.       if$
  294.     }
  295.   while$
  296. }
  297.  
  298. FUNCTION {format.date}
  299. { year empty$
  300.     { month empty$
  301.     { "" }
  302.     { "there's a month but no year in " cite$ * warning$
  303.       month
  304.     }
  305.       if$
  306.     }
  307.     { month empty$
  308.     'year 
  309.     { year }
  310.       if$
  311.     }
  312.   if$
  313. }
  314.  
  315. FUNCTION {newformat.date}
  316. format.date extra.label purify$ * 
  317. }
  318.  
  319. FUNCTION {format.btitle}
  320. { title emphasize
  321. }
  322.  
  323. FUNCTION {tie.or.space.connect}
  324. { duplicate$ text.length$ #3 <
  325.     { "~" }
  326.     { " " }
  327.   if$
  328.   swap$ * *
  329. }
  330.  
  331. FUNCTION {either.or.check}
  332. { empty$
  333.     'pop$
  334.     { "can't use both " swap$ * " fields in " * cite$ * warning$ }
  335.   if$
  336. }
  337.  
  338. FUNCTION {format.bvolume}
  339. { volume empty$
  340.     { "" }
  341.     { "volume" volume tie.or.space.connect
  342.       series empty$
  343.     'skip$
  344.     { " of " * series emphasize * }
  345.       if$
  346.       "volume and number" number either.or.check
  347.     }
  348.   if$
  349. }
  350.  
  351. FUNCTION {format.number.series}
  352. { volume empty$
  353.     { number empty$
  354.     { series field.or.null }
  355.     { output.state mid.sentence =
  356.         { "number" }
  357.         { "Number" }
  358.       if$
  359.       number tie.or.space.connect
  360.       series empty$
  361.         { "there's a number but no series in " cite$ * warning$ }
  362.         { " in " * series * }
  363.       if$
  364.     }
  365.       if$
  366.     }
  367.     { "" }
  368.   if$
  369. }
  370.  
  371. FUNCTION {format.edition}
  372. { edition empty$
  373.     { "" }
  374.     { output.state mid.sentence =
  375.     { edition "l" change.case$ " edition" * }
  376.     { edition "t" change.case$ " edition" * }
  377.       if$
  378.     }
  379.   if$
  380. }
  381.  
  382. INTEGERS { multiresult }
  383.  
  384. FUNCTION {multi.page.check}
  385. { 't :=
  386.   #0 'multiresult :=
  387.     { multiresult not
  388.       t empty$ not
  389.       and
  390.     }
  391.     { t #1 #1 substring$
  392.       duplicate$ "-" =
  393.       swap$ duplicate$ "," =
  394.       swap$ "+" =
  395.       or or
  396.     { #1 'multiresult := }
  397.     { t #2 global.max$ substring$ 't := }
  398.       if$
  399.     }
  400.   while$
  401.   multiresult
  402. }
  403.  
  404. FUNCTION {format.pages}
  405. { pages empty$
  406.     { "" }
  407.     { pages multi.page.check
  408.     { "pages" pages n.dashify tie.or.space.connect }
  409.     { "page" pages tie.or.space.connect }
  410.       if$
  411.     }
  412.   if$
  413. }
  414.  
  415. FUNCTION {format.vol.num.pages}
  416. { volume embolden field.or.null 
  417.   number empty$
  418.     'skip$
  419.     { "(" number * ")" * *
  420.       volume empty$
  421.     { "there's a number but no volume in " cite$ * warning$ }
  422.     'skip$
  423.       if$
  424.     }
  425.   if$
  426.   pages empty$
  427.     'skip$
  428.     { duplicate$ empty$
  429.     { pop$ format.pages }
  430.     { " pp. " * pages n.dashify * }
  431.       if$
  432.     }
  433.   if$
  434. }
  435.  
  436. FUNCTION {format.chapter.pages}
  437. { chapter empty$
  438.     'format.pages
  439.     { type empty$
  440.     { "chapter" }
  441.     { type "l" change.case$ }
  442.       if$
  443.       chapter tie.or.space.connect
  444.       pages empty$
  445.     'skip$
  446.     { ", " * format.pages * }
  447.       if$
  448.     }
  449.   if$
  450. }
  451.  
  452. FUNCTION {format.in.ed.booktitle}
  453. { booktitle empty$
  454.     { "" }
  455.     { editor empty$
  456.     { "In " booktitle emphasize * }
  457.     { "In " format.editors * ", " * booktitle emphasize * }
  458.       if$
  459.     }
  460.   if$
  461. }
  462.  
  463. FUNCTION {empty.misc.check}
  464. { author empty$ title empty$ howpublished empty$
  465.   month empty$ year empty$ note empty$
  466.   and and and and and
  467.   key empty$ not and
  468.     { "all relevant fields are empty in " cite$ * warning$ }
  469.     'skip$
  470.   if$
  471. }
  472.  
  473. FUNCTION {format.thesis.type}
  474. { type empty$
  475.     'skip$
  476.     { pop$
  477.       type "t" change.case$
  478.     }
  479.   if$
  480. }
  481.  
  482. FUNCTION {format.tr.number}
  483. { type empty$
  484.     { "Technical Report" }
  485.     'type
  486.   if$
  487.   number empty$
  488.     { "t" change.case$ }
  489.     { number tie.or.space.connect }
  490.   if$
  491. }
  492.  
  493. FUNCTION {format.article.crossref}
  494. { key empty$
  495.     { journal empty$
  496.     { "need key or journal for " cite$ * " to crossref " * crossref *
  497.       warning$
  498.       ""
  499.     }
  500.     { "In {\em " journal * "\/}" * }
  501.       if$
  502.     }
  503.     { "In " key * }
  504.   if$
  505.   " \cite{" * crossref * "}" *
  506. }
  507.  
  508. FUNCTION {format.crossref.editor}
  509. { editor #1 "{vv~}{ll}" format.name$
  510.   editor num.names$ duplicate$
  511.   #2 >
  512.     { pop$ " et~al." * }
  513.     { #2 <
  514.     'skip$
  515.     { editor #2 "{ff }{vv }{ll}{ jj}" format.name$ "others" =
  516.         { " et~al." * }
  517.         { " and " * editor #2 "{vv~}{ll}" format.name$ * }
  518.       if$
  519.     }
  520.       if$
  521.     }
  522.   if$
  523. }
  524.  
  525. FUNCTION {format.book.crossref}
  526. { volume empty$
  527.     { "empty volume in " cite$ * "'s crossref of " * crossref * warning$
  528.       "In "
  529.     }
  530.     { "Volume" volume tie.or.space.connect
  531.       " of " *
  532.     }
  533.   if$
  534.   editor empty$
  535.   editor field.or.null author field.or.null =
  536.   or
  537.     { key empty$
  538.     { series empty$
  539.         { "need editor, key, or series for " cite$ * " to crossref " *
  540.           crossref * warning$
  541.           "" *
  542.         }
  543.         { "{\em " * series * "\/}" * }
  544.       if$
  545.     }
  546.     { key * }
  547.       if$
  548.     }
  549.     { format.crossref.editor * }
  550.   if$
  551.   " \cite{" * crossref * "}" *
  552. }
  553.  
  554. FUNCTION {format.incoll.inproc.crossref}
  555. { editor empty$
  556.   editor field.or.null author field.or.null =
  557.   or
  558.     { key empty$
  559.     { booktitle empty$
  560.         { "need editor, key, or booktitle for " cite$ * " to crossref " *
  561.           crossref * warning$
  562.           ""
  563.         }
  564.         { "In {\em " booktitle * "\/}" * }
  565.       if$
  566.     }
  567.     { "In " key * }
  568.       if$
  569.     }
  570.     { "In " format.crossref.editor * }
  571.   if$
  572.   " \cite{" * crossref * "}" *
  573. }
  574.  
  575. FUNCTION {article}
  576. { output.bibitem
  577.   format.authors "author" output.check
  578.   newformat.date "year" output.check
  579.   new.block
  580.   format.title "title" output.check
  581.   new.block
  582.   crossref missing$
  583.     { journal emphasize "journal" output.check
  584.       format.vol.num.pages output
  585.           }
  586.     { format.article.crossref output.nonnull
  587.       format.pages output
  588.     }
  589.   if$
  590.   new.block
  591.   note output
  592.   fin.entry
  593. }
  594.  
  595. FUNCTION {book}
  596. { output.bibitem
  597.   author empty$
  598.     { format.editors "author and editor" output.check }
  599.     { format.authors output.nonnull
  600.       crossref missing$
  601.     { "author and editor" editor either.or.check }
  602.     'skip$
  603.       if$
  604.     }
  605.   if$
  606.   newformat.date "year" output.check
  607.   new.block
  608.   format.btitle "title" output.check
  609.   crossref missing$
  610.     { format.bvolume output
  611.       new.block
  612.       format.number.series output
  613.       new.sentence
  614.       publisher "publisher" output.check
  615.       address output
  616.     }
  617.     { new.block
  618.       format.book.crossref output.nonnull
  619.     }
  620.   if$
  621.   format.edition output
  622.   new.block
  623.   note output
  624.   fin.entry
  625. }
  626.  
  627. FUNCTION {booklet}
  628. { output.bibitem
  629.   format.authors output
  630.   newformat.date output
  631.   new.block
  632.   format.title "title" output.check
  633.   howpublished address new.block.checkb
  634.   howpublished output
  635.   address output
  636.   new.block
  637.   note output
  638.   fin.entry
  639. }
  640.  
  641. FUNCTION {inbook}
  642. { output.bibitem
  643.   author empty$
  644.     { format.editors "author and editor" output.check }
  645.     { format.authors output.nonnull
  646.       crossref missing$
  647.     { "author and editor" editor either.or.check }
  648.     'skip$
  649.       if$
  650.     }
  651.   if$
  652.   newformat.date "year" output.check
  653.   new.block
  654.   format.btitle "title" output.check
  655.   crossref missing$
  656.     { format.bvolume output
  657.       format.chapter.pages "chapter and pages" output.check
  658.       new.block
  659.       format.number.series output
  660.       new.sentence
  661.       publisher "publisher" output.check
  662.       address output
  663.     }
  664.     { format.chapter.pages "chapter and pages" output.check
  665.       new.block
  666.       format.book.crossref output.nonnull
  667.     }
  668.   if$
  669.   format.edition output
  670.   new.block
  671.   note output
  672.   fin.entry
  673. }
  674.  
  675. FUNCTION {incollection}
  676. { output.bibitem
  677.   format.authors "author" output.check
  678.   newformat.date "year" output.check
  679.   new.block
  680.   format.title "title" output.check
  681.   new.block
  682.   crossref missing$
  683.     { format.in.ed.booktitle "booktitle" output.check
  684.       format.bvolume output
  685.       format.number.series output
  686.       format.chapter.pages output
  687.       new.sentence
  688.       publisher "publisher" output.check
  689.       address output
  690.       format.edition output
  691.     }
  692.     { format.incoll.inproc.crossref output.nonnull
  693.       format.chapter.pages output
  694.     }
  695.   if$
  696.   new.block
  697.   note output
  698.   fin.entry
  699. }
  700.  
  701. FUNCTION {inproceedings}
  702. { output.bibitem
  703.   format.authors "author" output.check
  704.   newformat.date "year" output.check
  705.   new.block
  706.   format.title "title" output.check
  707.   new.block
  708.   crossref missing$
  709.     { format.in.ed.booktitle "booktitle" output.check
  710.       format.bvolume output
  711.       format.number.series output
  712.       format.pages output
  713.       address empty$
  714.     { organization publisher new.sentence.checkb
  715.       organization output
  716.       publisher output
  717.     }
  718.     { address output.nonnull
  719.       new.sentence
  720.       organization output
  721.       publisher output
  722.     }
  723.       if$
  724.     }
  725.     { format.incoll.inproc.crossref output.nonnull
  726.       format.pages output
  727.     }
  728.   if$
  729.   new.block
  730.   note output
  731.   fin.entry
  732. }
  733.  
  734. FUNCTION {conference} { inproceedings }
  735.  
  736. FUNCTION {manual}
  737. { output.bibitem
  738.   author empty$
  739.     { organization empty$
  740.     'skip$
  741.     { organization output.nonnull
  742.       address output
  743.     }
  744.       if$
  745.     }
  746.     { format.authors output.nonnull }
  747.   if$
  748.   newformat.date output
  749.   new.block
  750.   format.btitle "title" output.check
  751.   author empty$
  752.     { organization empty$
  753.     { address new.block.checka
  754.       address output
  755.     }
  756.     'skip$
  757.       if$
  758.     }
  759.     { organization address new.block.checkb
  760.       organization output
  761.       address output
  762.     }
  763.   if$
  764.   format.edition output
  765.   new.block
  766.   note output
  767.   fin.entry
  768. }
  769.  
  770. FUNCTION {mastersthesis}
  771. { output.bibitem
  772.   format.authors "author" output.check
  773.   newformat.date "year" output.check
  774.   new.block
  775.   format.title "title" output.check
  776.   new.block
  777.   "Master's thesis" format.thesis.type output.nonnull
  778.   school "school" output.check
  779.   address output
  780.   new.block
  781.   note output
  782.   fin.entry
  783. }
  784.  
  785. FUNCTION {misc}
  786. { output.bibitem
  787.   format.authors output
  788.   newformat.date output
  789.   title howpublished new.block.checkb
  790.   format.title output
  791.   howpublished new.block.checka
  792.   howpublished output
  793.   new.block
  794.   note output
  795.   fin.entry
  796.   empty.misc.check
  797. }
  798.  
  799. FUNCTION {phdthesis}
  800. { output.bibitem
  801.   format.authors "author" output.check
  802.   newformat.date "year" output.check
  803.   new.block
  804.   format.btitle "title" output.check
  805.   new.block
  806.   "PhD thesis" format.thesis.type output.nonnull
  807.   school "school" output.check
  808.   address output
  809.   new.block
  810.   note output
  811.   fin.entry
  812. }
  813.  
  814. FUNCTION {proceedings}
  815. { output.bibitem
  816.   editor empty$
  817.     { organization output }
  818.     { format.editors output.nonnull }
  819.   if$
  820.       newformat.date "year" output.check
  821.   new.block
  822.   format.btitle "title" output.check
  823.   format.bvolume output
  824.   format.number.series output
  825.   address empty$
  826.     { editor empty$
  827.     { publisher new.sentence.checka }
  828.     { organization publisher new.sentence.checkb
  829.       organization output
  830.     }
  831.       if$
  832.       publisher output
  833.       newformat.date "year" output.check
  834.     }
  835.     { address output.nonnull
  836.       new.sentence
  837.       editor empty$
  838.     'skip$
  839.     { organization output }
  840.       if$
  841.       publisher output
  842.     }
  843.   if$
  844.   new.block
  845.   note output
  846.   fin.entry
  847. }
  848.  
  849. FUNCTION {techreport}
  850. { output.bibitem
  851.   format.authors "author" output.check
  852.   newformat.date "year" output.check
  853.   new.block
  854.   format.title "title" output.check
  855.   new.block
  856.   format.tr.number output.nonnull
  857.   institution "institution" output.check
  858.   address output
  859.   new.block
  860.   note output
  861.   fin.entry
  862. }
  863.  
  864. FUNCTION {unpublished}
  865. { output.bibitem
  866.   format.authors "author" output.check
  867.   newformat.date output
  868.   new.block
  869.   format.title "title" output.check
  870.   new.block
  871.   note "note" output.check
  872.   fin.entry
  873. }
  874.  
  875. FUNCTION {default.type} { misc }
  876.  
  877. MACRO {jan} {"January"}
  878.  
  879. MACRO {feb} {"February"}
  880.  
  881. MACRO {mar} {"March"}
  882.  
  883. MACRO {apr} {"April"}
  884.  
  885. MACRO {may} {"May"}
  886.  
  887. MACRO {jun} {"June"}
  888.  
  889. MACRO {jul} {"July"}
  890.  
  891. MACRO {aug} {"August"}
  892.  
  893. MACRO {sep} {"September"}
  894.  
  895. MACRO {oct} {"October"}
  896.  
  897. MACRO {nov} {"November"}
  898.  
  899. MACRO {dec} {"December"}
  900.  
  901. MACRO {acmcs} {"ACM Computing Surveys"}
  902.  
  903. MACRO {acta} {"Acta Informatica"}
  904.  
  905. MACRO {cacm} {"Communications of the ACM"}
  906.  
  907. MACRO {ibmjrd} {"IBM Journal of Research and Development"}
  908.  
  909. MACRO {ibmsj} {"IBM Systems Journal"}
  910.  
  911. MACRO {ieeese} {"IEEE Transactions on Software Engineering"}
  912.  
  913. MACRO {ieeetc} {"IEEE Transactions on Computers"}
  914.  
  915. MACRO {ieeetcad}
  916.  {"IEEE Transactions on Computer-Aided Design of Integrated Circuits"}
  917.  
  918. MACRO {ipl} {"Information Processing Letters"}
  919.  
  920. MACRO {jacm} {"Journal of the ACM"}
  921.  
  922. MACRO {jcss} {"Journal of Computer and System Sciences"}
  923.  
  924. MACRO {scp} {"Science of Computer Programming"}
  925.  
  926. MACRO {sicomp} {"SIAM Journal on Computing"}
  927.  
  928. MACRO {tocs} {"ACM Transactions on Computer Systems"}
  929.  
  930. MACRO {tods} {"ACM Transactions on Database Systems"}
  931.  
  932. MACRO {tog} {"ACM Transactions on Graphics"}
  933.  
  934. MACRO {toms} {"ACM Transactions on Mathematical Software"}
  935.  
  936. MACRO {toois} {"ACM Transactions on Office Information Systems"}
  937.  
  938. MACRO {toplas} {"ACM Transactions on Programming Languages and Systems"}
  939.  
  940. MACRO {tcs} {"Theoretical Computer Science"}
  941.  
  942. READ
  943.  
  944. FUNCTION {sortify}
  945. { purify$
  946.   "l" change.case$
  947. }
  948.  
  949. INTEGERS { len }
  950.  
  951. FUNCTION {chop.word}
  952. { 's :=
  953.   'len :=
  954.   s #1 len substring$ =
  955.     { s len #1 + global.max$ substring$ }
  956.     's
  957.   if$
  958. }
  959.  
  960. INTEGERS { et.al.char.used }
  961.  
  962. FUNCTION {initialize.et.al.char.used}
  963. { #0 'et.al.char.used :=
  964. }
  965.  
  966. EXECUTE {initialize.et.al.char.used}
  967.  
  968.  
  969. FUNCTION {format.lab.names}
  970. { 's :=
  971.   s num.names$ 'numnames :=
  972.   numnames #1 >
  973.     { numnames #2 = 
  974.     {s #2 "{vv }{ll}{, jj}" format.name$ "others" =
  975.           {s #1 "{vv }{ll}{, jj}" format.name$ " {\em et al}, " *}
  976.       { s #1 "{vv }{ll}{, jj}" format.name$  " and " *
  977.       s #2 "{vv }{ll}{, jj}" format.name$ * ", " *
  978.           } if$ 
  979.         }
  980.         {s #1 "{vv }{ll}{, jj}" format.name$ 
  981.                  " {\em et al}, " *
  982.           #1 'et.al.char.used :=
  983.          }  
  984. if$ }
  985.         { s #1 "{vv }{ll}{, jj}" format.name$ ", " *
  986.     }
  987.   if$
  988. }
  989.  
  990.  
  991. FUNCTION {author.key.label}
  992. { author empty$
  993.     { key empty$
  994.     { cite$ #1 }
  995.     { key #3 text.prefix$ }
  996.       if$
  997.     }
  998.     { author format.lab.names }
  999.   if$
  1000. }
  1001.  
  1002. FUNCTION {author.editor.key.label}
  1003. { author empty$
  1004.     { editor empty$
  1005.     { key empty$
  1006.         { cite$ #1 }
  1007.         { key #3 text.prefix$ }
  1008.       if$
  1009.     }
  1010.     { editor format.lab.names }
  1011.       if$
  1012.     }
  1013.     { author format.lab.names }
  1014.   if$
  1015. }
  1016.  
  1017. FUNCTION {author.key.organization.label}
  1018. { author empty$
  1019.     { key empty$
  1020.     { organization empty$
  1021.         { cite$ #1 }
  1022.         { "The " #4 organization chop.word #3 text.prefix$ }
  1023.       if$
  1024.     }
  1025.     { key #3 text.prefix$ }
  1026.       if$
  1027.     }
  1028.     { author format.lab.names }
  1029.   if$
  1030. }
  1031.  
  1032. FUNCTION {editor.key.organization.label}
  1033. { editor empty$
  1034.     { key empty$
  1035.     { organization empty$
  1036.         { cite$ #1 }
  1037.         { "The " #4 organization chop.word #3 text.prefix$ }
  1038.       if$
  1039.     }
  1040.     { key #3 text.prefix$ }
  1041.       if$
  1042.     }
  1043.     { editor format.lab.names }
  1044.   if$
  1045. }
  1046.  
  1047. FUNCTION {calc.label}
  1048. { type$ "book" =
  1049.   type$ "inbook" =
  1050.   or
  1051.     'author.editor.key.label
  1052.     { type$ "proceedings" =
  1053.     'editor.key.organization.label
  1054.     { type$ "manual" =
  1055.         'author.key.organization.label
  1056.         'author.key.label
  1057.       if$
  1058.     }
  1059.       if$
  1060.     }
  1061.   if$
  1062.   duplicate$
  1063.   year field.or.null purify$ #-1 #4 substring$
  1064.   * 
  1065.   'label := 
  1066.   year field.or.null purify$ #-1 #4 substring$
  1067.   * 
  1068.   sortify 'sort.label :=
  1069. }
  1070.  
  1071. FUNCTION {sort.format.names}
  1072. { 's :=
  1073.   #1 'nameptr :=
  1074.   ""
  1075.   s num.names$ 'numnames :=
  1076.   numnames 'namesleft :=
  1077.     { namesleft #0 > }
  1078.     { nameptr #1 >
  1079.     { "   " * }
  1080.     'skip$
  1081.       if$
  1082.       s nameptr "{vv{ } }{ll{ }}{  ff{ }}{  jj{ }}" format.name$ 't :=
  1083.       nameptr numnames = t "others" = and
  1084.     { "et al" * }
  1085.     { t sortify * }
  1086.       if$
  1087.       nameptr #1 + 'nameptr :=
  1088.       namesleft #1 - 'namesleft :=
  1089.     }
  1090.   while$
  1091. }
  1092.  
  1093. FUNCTION {sort.format.title}
  1094. { 't :=
  1095.   "A " #2
  1096.     "An " #3
  1097.       "The " #4 t chop.word
  1098.     chop.word
  1099.   chop.word
  1100.   sortify
  1101.   #1 global.max$ substring$
  1102. }
  1103.  
  1104. FUNCTION {author.sort}
  1105. { author empty$
  1106.     { key empty$
  1107.     { "to sort, need author or key in " cite$ * warning$
  1108.       ""
  1109.     }
  1110.     { key sortify }
  1111.       if$
  1112.     }
  1113.     { author sort.format.names }
  1114.   if$
  1115. }
  1116.  
  1117. FUNCTION {author.editor.sort}
  1118. { author empty$
  1119.     { editor empty$
  1120.     { key empty$
  1121.         { "to sort, need author, editor, or key in " cite$ * warning$
  1122.           ""
  1123.         }
  1124.         { key sortify }
  1125.       if$
  1126.     }
  1127.     { editor sort.format.names }
  1128.       if$
  1129.     }
  1130.     { author sort.format.names }
  1131.   if$
  1132. }
  1133.  
  1134. FUNCTION {author.organization.sort}
  1135. { author empty$
  1136.     { organization empty$
  1137.     { key empty$
  1138.         { "to sort, need author, organization, or key in " cite$ * warning$
  1139.           ""
  1140.         }
  1141.         { key sortify }
  1142.       if$
  1143.     }
  1144.     { "The " #4 organization chop.word sortify }
  1145.       if$
  1146.     }
  1147.     { author sort.format.names }
  1148.   if$
  1149. }
  1150.  
  1151. FUNCTION {editor.organization.sort}
  1152. { editor empty$
  1153.     { organization empty$
  1154.     { key empty$
  1155.         { "to sort, need editor, organization, or key in " cite$ * warning$
  1156.           ""
  1157.         }
  1158.         { key sortify }
  1159.       if$
  1160.     }
  1161.     { "The " #4 organization chop.word sortify }
  1162.       if$
  1163.     }
  1164.     { editor sort.format.names }
  1165.   if$
  1166. }
  1167.  
  1168. FUNCTION {presort}
  1169. { calc.label
  1170.   sort.label
  1171.   "    "
  1172.   *
  1173.   type$ "book" =
  1174.   type$ "inbook" =
  1175.   or
  1176.     'author.editor.sort
  1177.     { type$ "proceedings" =
  1178.     'editor.organization.sort
  1179.     { type$ "manual" =
  1180.         'author.organization.sort
  1181.         'author.sort
  1182.       if$
  1183.     }
  1184.       if$
  1185.     }
  1186.   if$
  1187.   *
  1188.   "    "
  1189.   *
  1190.   year field.or.null sortify
  1191.   *
  1192.   "    "
  1193.   *
  1194.   title field.or.null
  1195.   sort.format.title
  1196.   *
  1197.   #1 entry.max$ substring$
  1198.   'sort.key$ :=
  1199. }
  1200.  
  1201. ITERATE {presort}
  1202.  
  1203. SORT
  1204.  
  1205. STRINGS { longest.label last.sort.label next.extra last.author }
  1206.  
  1207. INTEGERS { longest.label.width last.extra.num samenamenum }
  1208.  
  1209. FUNCTION {initialize.longest.label}
  1210. { "" 'longest.label :=
  1211.   #0 int.to.chr$ 'last.sort.label :=
  1212.   "" 'next.extra :=
  1213.   #0 'longest.label.width :=
  1214.   #0 'last.extra.num :=
  1215.   "" 'last.author :=
  1216. }
  1217.  
  1218. FUNCTION {forward.pass}
  1219. { last.sort.label sort.label =
  1220.     { last.extra.num #1 + 'last.extra.num :=
  1221.       last.extra.num int.to.chr$ "" * 'extra.label :=
  1222.     }
  1223.     { "a" chr.to.int$ 'last.extra.num :=
  1224.       "" 'extra.label :=
  1225.       sort.label 'last.sort.label :=
  1226.     }
  1227.   if$
  1228. }
  1229.  
  1230. FUNCTION {forward.pass2}
  1231. { author 's :=
  1232.   #0 'samenamenum :=
  1233.   #1 'nameptr :=
  1234.   s num.names$ 'numnames :=
  1235.   last.author num.names$ 'lastnumnames :=
  1236.    numnames lastnumnames <
  1237.     { numnames 'leastnames := }
  1238.     { lastnumnames 'leastnames := }
  1239.   if$
  1240.    leastnames 'namesleft :=
  1241.     {namesleft #0 > }  
  1242.     { s nameptr "{f.~}{vv~}{ll}{, jj}" format.name$
  1243.       last.author nameptr "{f.~}{vv~}{ll}{, jj}" format.name$ =
  1244.     {samenamenum #1 + 'samenamenum := 
  1245.     namesleft #1 - 'namesleft :=
  1246.     nameptr #1 + 'nameptr :=}
  1247.     {#0 'namesleft :=}
  1248.   if$
  1249.   }
  1250. while$
  1251. s 'last.author :=
  1252. samenamenum int.to.str$ 'names :=
  1253. }
  1254.     
  1255. FUNCTION {reverse.pass}
  1256. { next.extra "b" =
  1257.     { "a" 'extra.label := }
  1258.     'skip$
  1259.   if$
  1260.   label extra.label * 'label :=
  1261.   label width$ longest.label.width >
  1262.     { label 'longest.label :=
  1263.       label width$ 'longest.label.width :=
  1264.     }
  1265.     'skip$
  1266.   if$
  1267.   extra.label 'next.extra :=
  1268. }
  1269.  
  1270. EXECUTE {initialize.longest.label}
  1271.  
  1272. ITERATE {forward.pass}
  1273.  
  1274. REVERSE {reverse.pass}
  1275.  
  1276. ITERATE {forward.pass2}
  1277.  
  1278. FUNCTION {begin.bib}
  1279. { et.al.char.used
  1280.     { "\newcommand{\etalchar}[1]{$^{#1}$}" write$ newline$ }
  1281.     'skip$
  1282.   if$
  1283.   preamble$ empty$
  1284.     'skip$
  1285.     { preamble$ write$ newline$ }
  1286.   if$
  1287.   "\begin{thebibliography}{"  longest.label  * "}" * write$ newline$
  1288. }
  1289.  
  1290. EXECUTE {begin.bib}
  1291.  
  1292. EXECUTE {init.state.consts}
  1293.  
  1294. ITERATE {call.type$}
  1295.  
  1296. FUNCTION {end.bib}
  1297. { newline$
  1298.   "\end{thebibliography}" write$ newline$
  1299. }
  1300.  
  1301. EXECUTE {end.bib}
  1302.